package hy.demo2;

import com.fasterxml.jackson.annotation.JsonSubTypes;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.annotation.Bean;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestApp {
    ClassPathXmlApplicationContext a;
    @Before
    public  void init() {
        a=new ClassPathXmlApplicationContext("demo2/day1_demo2.xml");
    }
    @Test
    public void test1(){
        System.out.println(a.getBean("s"));
    }
    @Test
    public void test2(){
        System.out.println(a.getBean("p"));
    }

    @Test
    public void test3(){
        Dept d=a.getBean(Dept.class);
        System.out.println(d);
    }
}
